var express = require('express');
var router = new express.Router();
var Mock = require('mockjs')

router.get('/list', function (req, res) {
  var instock = Mock.mock({
    'list|5': [{
      'name|1':[],
      age: '@natural(20,70)',
      'gender|1':['花漾甜心','反转巴黎','幻彩鎏金','筑梦天马','罪恶晚香玉','无花果','冥府之路','蝴蝶夫人','摩登小姐','莫妮卡小姐','女神心愿','挚爱倾城','流金岁月','复乐园','鼠尾草与海盐','信仰银色山泉','柏林少女','日本晚樱花','邂逅柔情','人间水蜜桃','落楼甜情','无人区玫瑰','蓝风铃','许愿精灵'],
      'phoneNumber':/\d{5,10}/,
    }]
  })


  res.send(instock.list);

})
var instock=[];

router.get('/add',function (request,response) {
  console.log(request.query);
  instock.unshift(request.query)
  response.send({
    emps:instock,
    flag:true
  })
})
module.exports= router;
